<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Blog</title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
  </head>
  <body>
    <header>
      <h1><%= title %></h1>
    </header>

    <nav>
      <span><a tile="主页" href="/">home</a></span>
      <% if (user) { %>
        <span><a tile="发表" href="/post">post</a></span>
        <span><a tile="登出" href="/logout">logout</a></span>
      <% } else { %>
        <span><a tile="登录" href="/login">login</a></span>
        <span><a tile="注册" href="/reg">register</a></span>
      <% } %>
    </nav>

    <article>
        <% if (success) { %>
            <div><%= success %></div>
        <% } %>
        <% if (error) { %>
            <div><%= error %></div>
        <% } %>